{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "# output of tool D\n",
    "parent_folder = '/Users/kavyasrinet/Desktop/other_actions/0/'\n",
    "folder_name_D = parent_folder + 'toolD/'\n",
    "tool_D_out_file = folder_name_D + 'all_agreements.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [],
   "source": [
    "# output of tool C\n",
    "parent_folder= '/Users/kavyasrinet/Desktop/other_actions/5/'\n",
    "folder_name_C = parent_folder  + 'toolC/'\n",
    "tool_C_out_file = folder_name_C + 'all_agreements.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "27\n"
     ]
    }
   ],
   "source": [
    "# combine outputs\n",
    "# check if all keys of tool C annotated yes -> put directly\n",
    "# if no , check child in t2 and combine\n",
    "# construct mape of tool 1\n",
    "\n",
    "toolC_map = {}\n",
    "\n",
    "import ast\n",
    "import os.path\n",
    "from os import path\n",
    "if path.exists(tool_C_out_file):\n",
    "    with open(tool_C_out_file) as f:\n",
    "        for line in f.readlines():\n",
    "            line = line.strip()\n",
    "            cmd, ref_obj_text, a_d = line.split(\"\\t\")\n",
    "            if cmd in toolC_map:\n",
    "                toolC_map[cmd].update(ast.literal_eval(a_d))\n",
    "            else:\n",
    "                toolC_map[cmd]= ast.literal_eval(a_d)\n",
    "print(len(toolC_map.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n"
     ]
    }
   ],
   "source": [
    "# construct map of tool 2\n",
    "toolD_map = {}\n",
    "\n",
    "if path.exists(tool_D_out_file):\n",
    "    with open(tool_D_out_file) as f2:\n",
    "        for line in f2.readlines():\n",
    "            line = line.strip()\n",
    "            cmd, comparison_text, comparison_dict = line.split(\"\\t\")\n",
    "            if cmd in toolD_map:\n",
    "                print(\"BUGGGGG\")\n",
    "            # add the comparison dict to command -> dict\n",
    "            toolD_map[cmd] = ast.literal_eval(comparison_dict)      \n",
    "print(len(toolD_map.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ast\n",
    "def all_yes(a_dict):\n",
    "    if type(a_dict) == str:\n",
    "        a_dict = ast.literal_eval(a_dict)\n",
    "    for k, val in a_dict.items():\n",
    "        if type(val) == list and val[0] == \"no\":\n",
    "            return False\n",
    "    return True\n",
    "\n",
    "def clean_up_dict(a_dict):\n",
    "    if type(a_dict) == str:\n",
    "        a_dict = ast.literal_eval(a_dict)\n",
    "    new_d = {}\n",
    "    for k, val in a_dict.items():\n",
    "        if type(val) == list:\n",
    "            if val[0] in [\"yes\", \"no\"]:\n",
    "                new_d[k] = val[1]                \n",
    "        elif type(val) == dict:\n",
    "            new_d[k] = clean_up_dict(val)\n",
    "        else:\n",
    "            new_d[k] = val\n",
    "    return new_d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "metadata": {},
   "outputs": [],
   "source": [
    "# post_process spans and \"contains_coreference\" : \"no\"\n",
    "def merge_indices(indices):\n",
    "    a, b = indices[0]\n",
    "    for i in range(1, len(indices)):\n",
    "        a = min(a, indices[i][0])\n",
    "        b = max(b, indices[i][1])\n",
    "    return [a, b]\n",
    "\n",
    "\n",
    "def fix_spans(d):\n",
    "    new_d = {}\n",
    "    if type(d) == str:\n",
    "        d = ast.literal_eval(d)\n",
    "    for k, v in d.items():\n",
    "        if k == \"contains_coreference\" and v == \"no\":\n",
    "            continue\n",
    "        if type(v) == list:\n",
    "            new_d[k] = [0, merge_indices(v)] \n",
    "            continue\n",
    "        elif type(v) == dict:\n",
    "            new_d[k] = fix_spans(v)\n",
    "            continue\n",
    "        else:\n",
    "            new_d[k] = v\n",
    "    return new_d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fix_ref_obj(clean_dict):\n",
    "    val = clean_dict\n",
    "    new_clean_dict = {}\n",
    "    if 'special_reference' in val:\n",
    "        new_clean_dict['special_reference'] = val['special_reference']\n",
    "        val.pop('special_reference')\n",
    "    if 'repeat' in val:\n",
    "        new_clean_dict['repeat'] = val['repeat']\n",
    "        val.pop('repeat')\n",
    "    if val:\n",
    "        new_clean_dict['filters'] = val\n",
    "    return new_clean_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'and add it to the tree': {'reference_object': {'filters': {'contains_coreference': 'yes'}}},\n",
      " 'bot bring me my red pants suit': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                                    'reference_object': {'filters': {'has_colour': [[4,\n",
      "                                                                                     4]],\n",
      "                                                                     'has_name': [[5,\n",
      "                                                                                   5],\n",
      "                                                                                  [6,\n",
      "                                                                                   6]]}}},\n",
      " 'chop a tree': {'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'collect the mushrooms here': {'reference_object': {'filters': {'has_name': [[2,\n",
      "                                                                               2]]}}},\n",
      " 'find a villiage': {'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'find diamons': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'find me a cow': {'reference_object': {'filters': {'has_name': [[3, 3]]}}},\n",
      " 'get bricks': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'get plant': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'get redstone from your inventory': {'reference_object': {'filters': {'has_name': [[1,\n",
      "                                                                                     1]]}}},\n",
      " 'get wood': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'get wool': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'give me a axe': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                   'reference_object': {'filters': {'has_name': [[3, 3]]}}},\n",
      " 'give me a brick': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                     'reference_object': {'filters': {'has_name': [[3, 3]]}}},\n",
      " 'give me stone': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                   'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'give me wool': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                  'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'go get flower': {'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'hand me that axe': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                      'reference_object': {'filters': {'contains_coreference': 'yes'}}},\n",
      " 'hey bot can you grab some wood for me': {'receiver_reference_object': {'special_reference': 'SPEAKER'},\n",
      "                                           'reference_object': {'filters': {'has_name': [[6,\n",
      "                                                                                          6]]}}},\n",
      " 'move the book to inside the house': {'reference_object': {'filters': {'has_name': [[2,\n",
      "                                                                                      2]]}}},\n",
      " 'pick flower': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'pick this up': {'reference_object': {'filters': {'contains_coreference': 'yes'}}},\n",
      " 'place block': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'place five pigs': {'reference_object': {'filters': {'has_name': [[2, 2]]}}},\n",
      " 'place it': {'reference_object': {'filters': {'contains_coreference': 'yes'}}},\n",
      " 'show fire': {'reference_object': {'filters': {'has_name': [[1, 1]]}}},\n",
      " 'take some dirt from the pile': {'reference_object': {'filters': {'has_name': [[2,\n",
      "                                                                                 2]]}}}}\n"
     ]
    }
   ],
   "source": [
    "# combine and write output to a file\n",
    "i  =0\n",
    "# what these action will look like in the map\n",
    "import json\n",
    "\n",
    "toolC_updated_map = {}\n",
    "\n",
    "from pprint import pprint\n",
    "# update dict of toolC with tool D and keep that in tool C's map\n",
    "#pprint(toolC_map)\n",
    "for cmd, a_dict in toolC_map.items():\n",
    "    # remove the ['yes', val] etc\n",
    "    for key in a_dict.keys():\n",
    "        a_dict_child = a_dict[key]\n",
    "        #pprint(a_dict_child)\n",
    "        clean_dict = clean_up_dict(a_dict_child)\n",
    "        # add in filters to reference objects\n",
    "#         val = clean_dict\n",
    "#         new_clean_dict = {}\n",
    "#         if 'special_reference' in val:\n",
    "#             new_clean_dict['special_reference'] = val['special_reference']\n",
    "#             val.pop('special_reference')\n",
    "#         if 'repeat' in val:\n",
    "#             new_clean_dict['repeat'] = val['repeat']\n",
    "#             val.pop('repeat')\n",
    "#         if val:\n",
    "#             new_clean_dict['filters'] = val\n",
    "        # fix reference object inside location of reference object\n",
    "        if 'location' in clean_dict and 'reference_object' in clean_dict['location']:\n",
    "            value =  clean_dict['location']['reference_object']\n",
    "            clean_dict['location']['reference_object'] =  fix_ref_obj(value)\n",
    "        new_clean_dict = fix_ref_obj(clean_dict)\n",
    "        \n",
    "        if all_yes(a_dict_child):\n",
    "            if cmd in toolC_updated_map:\n",
    "                toolC_updated_map[cmd][key] = new_clean_dict\n",
    "            else:\n",
    "                toolC_updated_map[cmd]= {key: new_clean_dict}\n",
    "            continue\n",
    "        new_clean_dict.pop('comparison', None)\n",
    "        comparison_dict = toolD_map[cmd] # check on this again\n",
    "\n",
    "        valid_dict = {}\n",
    "        valid_dict[key] = {}\n",
    "        #valid_dict['reference_object'] = {}\n",
    "#         valid_dict['reference_object']['filters'] = clean_dict\n",
    "#         valid_dict['reference_object']['filters'].update(comparison_dict)\n",
    "        valid_dict[key]['filters'] = new_clean_dict\n",
    "        valid_dict[key]['filters'].update(comparison_dict)\n",
    "        toolC_updated_map[cmd] = valid_dict # only gets populated if filters exist\n",
    "pprint(toolC_updated_map)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "27\n",
      "27\n"
     ]
    }
   ],
   "source": [
    "print(len(toolC_updated_map.keys()))\n",
    "print(len(toolC_map.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "# output of tool 1\n",
    "folder_name_A = parent_folder + 'toolA/'\n",
    "tool_A_out_file = folder_name_A + 'all_agreements.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {},
   "outputs": [],
   "source": [
    "# output of tool 2\n",
    "folder_name_B = parent_folder + 'toolB/'\n",
    "tool_B_out_file = folder_name_B + 'all_agreements.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "49\n"
     ]
    }
   ],
   "source": [
    "# combine outputs\n",
    "# check if all keys of t1 annotated yes -> put directly\n",
    "# if no , check child in t2 and combine\n",
    "# construct mape of tool 1\n",
    "toolA_map = {}\n",
    "with open(tool_A_out_file) as f:\n",
    "    for line in f.readlines():\n",
    "        line = line.strip()\n",
    "        cmd, a_d = line.split(\"\\t\")\n",
    "        toolA_map[cmd]= a_d\n",
    "print(len(toolA_map.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13\n"
     ]
    }
   ],
   "source": [
    "# construct map of tool 2\n",
    "toolB_map = {}\n",
    "import os.path\n",
    "from os import path\n",
    "\n",
    "if path.isfile(tool_B_out_file):\n",
    "    with open(tool_B_out_file) as f2:\n",
    "        for line in f2.readlines():\n",
    "            line = line.strip()\n",
    "            cmd, child, child_dict = line.split(\"\\t\")\n",
    "            if cmd in toolB_map and child in toolB_map[cmd]:\n",
    "                print(\"BUGGG\")\n",
    "            if cmd not in toolB_map:\n",
    "                toolB_map[cmd] = {}\n",
    "            toolB_map[cmd][child] = child_dict        \n",
    "print(len(toolB_map.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ast\n",
    "def all_yes(a_dict):\n",
    "    if type(a_dict) == str:\n",
    "        a_dict = ast.literal_eval(a_dict)\n",
    "    for k, val in a_dict.items():\n",
    "        if type(val) == list and val[0] == \"no\":\n",
    "            return False\n",
    "    return True\n",
    "\n",
    "def clean_dict_1(a_dict):\n",
    "    if type(a_dict) == str:\n",
    "        a_dict = ast.literal_eval(a_dict)\n",
    "    new_d = {}\n",
    "    for k, val in a_dict.items():\n",
    "        if type(val) == list:\n",
    "            if val[0] in [\"yes\", \"no\"]:\n",
    "                new_d[k] = val[1]                \n",
    "        elif type(val) == dict:\n",
    "            new_d[k] = a_dict(val[1])\n",
    "        else:\n",
    "            new_d[k] = val\n",
    "    # only for now\n",
    "    if 'dance_type_span' in new_d:\n",
    "        new_d['dance_type'] = {}\n",
    "        new_d['dance_type']['dance_type_name'] = new_d['dance_type_span']\n",
    "        new_d.pop('dance_type_span')\n",
    "    if 'dance_type_name' in new_d:\n",
    "        new_d['dance_type'] = {}\n",
    "        new_d['dance_type']['dance_type_name'] = new_d['dance_type_name']\n",
    "        new_d.pop('dance_type_name')\n",
    "    return new_d "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [],
   "source": [
    "# post_process spans and \"contains_coreference\" : \"no\"\n",
    "def merge_indices(indices):\n",
    "    a, b = indices[0]\n",
    "    for i in range(1, len(indices)):\n",
    "        a = min(a, indices[i][0])\n",
    "        b = max(b, indices[i][1])\n",
    "    return [a, b]\n",
    "\n",
    "def fix_put_mem(d):\n",
    "    \n",
    "    if type(d) == str:\n",
    "        d = ast.literal_eval(d)\n",
    "    new_d = copy.deepcopy(d)\n",
    "    del new_d['action_type']\n",
    "    if 'has_tag' in new_d and 'upsert' in new_d:\n",
    "        new_d['upsert']['memory_data']['has_tag'] = new_d['has_tag']\n",
    "        del new_d['has_tag']\n",
    "\n",
    "    return new_d\n",
    "\n",
    "def fix_spans(d):\n",
    "    new_d = {}\n",
    "    if type(d) == str:\n",
    "        d = ast.literal_eval(d)\n",
    "    for k, v in d.items():\n",
    "        if k == \"contains_coreference\" and v == \"no\":\n",
    "            continue\n",
    "        if type(v) == list:\n",
    "            if k == \"tag_val\":\n",
    "                new_d[\"has_tag\"] = [0, merge_indices(v)] \n",
    "            else:\n",
    "                new_d[k] = [0, merge_indices(v)] \n",
    "            continue\n",
    "        elif type(v) == dict:\n",
    "            new_d[k] = fix_spans(v)\n",
    "            continue\n",
    "        else:\n",
    "            new_d[k] = v\n",
    "    return new_d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'receiver_location': [[5, 5]]}\n",
      "and add it to the tree\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'location': {'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                                              [5,\n",
      "                                                                                               5]]}}}},\n",
      "                      'reference_object': {'filters': {'contains_coreference': 'yes'}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[3, 3], [4, 4], [5, 5], [6, 6]], 'receiver_reference_object': [[2, 2]]}\n",
      "bot bring me my red pants suit\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_colour': [0,\n",
      "                                                                      [4, 4]],\n",
      "                                                       'has_name': [0,\n",
      "                                                                    [5, 6]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'move', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'location': [[1, 1]], 'repeat': {'stop_condition': {'condition_type': 'NEVER'}}}\n",
      "chase cow\n",
      "{'action_sequence': [{'action_type': 'MOVE',\n",
      "                      'location': {'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  1]]}}},\n",
      "                      'repeat': {'stop_condition': {'condition_type': 'NEVER'}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'destroy', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]]}\n",
      "chop a tree\n",
      "{'action_sequence': [{'action_type': 'DESTROY',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'receiver_location': [[3, 3]]}\n",
      "collect the mushrooms here\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'location': {'contains_coreference': 'yes'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "dig all the herbs nearby and collect them to bring back to me so i can make potions to use in the game\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'otheraction', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "do something\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'OTHERACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'dance', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'location': [[1, 1], [3, 3], [5, 5], [6, 6], [8, 8], [9, 9]], 'dance_type': {'dance_type_name': [[0, 0]]}}\n",
      "duck under the overhang of that wall to your right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'dance_type_name': [0, [0, 0]]},\n",
      "                      'location': {'reference_object': {'filters': {'contains_coreference': 'yes',\n",
      "                                                                    'has_name': [0,\n",
      "                                                                                 [3,\n",
      "                                                                                  6]]}},\n",
      "                                   'relative_direction': 'DOWN'}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'fill', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]]}\n",
      "find a villiage\n",
      "{'action_sequence': [{'action_type': 'FILL',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'scout', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "find diamons\n",
      "{'action_sequence': [{'action_type': 'SCOUT',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'scout', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[3, 3]]}\n",
      "find me a cow\n",
      "{'action_sequence': [{'action_type': 'SCOUT',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [3, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "get bricks\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "get plant\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]], 'receiver_location': [[4, 4]]}\n",
      "get redstone from your inventory\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'location': {'reference_object': {'filters': {'contains_coreference': 'yes',\n",
      "                                                                                 'has_name': [0,\n",
      "                                                                                              [4,\n",
      "                                                                                               4]]}}}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "get that dustbin and take it to the road side for the collection guys\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "get wood\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "get wool\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[3, 3]], 'receiver_reference_object': [[1, 1]]}\n",
      "give me a axe\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [3, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[3, 3]], 'receiver_reference_object': [[1, 1]]}\n",
      "give me a brick\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [3, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'receiver_reference_object': [[1, 1]]}\n",
      "give me stone\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'receiver_reference_object': [[1, 1]]}\n",
      "give me wool\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "go deep into the cave and search for minerals\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]]}\n",
      "go get flower\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "go get some stone and build a castle with it\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "go to the window and observe player in the distance\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'otheraction', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "grow\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'OTHERACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2], [3, 3]], 'receiver_reference_object': [[1, 1]]}\n",
      "hand me that axe\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'contains_coreference': 'yes'}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[6, 6]], 'receiver_reference_object': [[8, 8]], 'repeat': {'repeat_key': 'FOR', 'repeat_count': [[5, 5]]}}\n",
      "hey bot can you grab some wood for me\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'reference_object': {'special_reference': 'SPEAKER'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [6, 6]]}},\n",
      "                      'repeat': {'repeat_count': [0, [5, 5]],\n",
      "                                 'repeat_key': 'FOR'}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'build', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'schematic': [[1, 1]]}\n",
      "install dog\n",
      "{'action_sequence': [{'action_type': 'BUILD',\n",
      "                      'schematic': {'has_name': [0, [1, 1]]}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'look', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'facing': [[1, 1], [3, 3]]}\n",
      "look ut the window\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'look_turn': {'location': {'location_type': 'REFERENCE_OBJECT',\n",
      "                                                                'reference_object': {'has_name': [0,\n",
      "                                                                                                  [3,\n",
      "                                                                                                   3]]},\n",
      "                                                                'relative_direction': 'OUTSIDE'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "make one tower green and the other tower turquoise\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'receiver_location': [[4, 4], [6, 6]]}\n",
      "move the book to inside the house\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'receiver': {'location': {'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                                              [6,\n",
      "                                                                                               6]]}},\n",
      "                                                'relative_direction': 'INSIDE'}},\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "move towards right and lay down\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "pick flower\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "pick this up\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'contains_coreference': 'yes'}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "place block\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'spawn', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'repeat': {'repeat_key': 'FOR', 'repeat_count': [[1, 1]]}}\n",
      "place five pigs\n",
      "{'action_sequence': [{'action_type': 'SPAWN',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}},\n",
      "                      'repeat': {'repeat_count': [0, [1, 1]],\n",
      "                                 'repeat_key': 'FOR'}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'copy', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "place it\n",
      "{'action_sequence': [{'action_type': 'COPY',\n",
      "                      'reference_object': {'filters': {'contains_coreference': 'yes'}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'build', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'location': [[2, 2]], 'schematic': [[1, 1]]}\n",
      "place sandstone there\n",
      "{'action_sequence': [{'action_type': 'BUILD',\n",
      "                      'location': {'contains_coreference': 'yes'},\n",
      "                      'schematic': {'has_name': [0, [1, 1]]}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'build', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'schematic': [[2, 2]], 'repeat': {'repeat_key': 'FOR', 'repeat_count': [[1, 1]]}}\n",
      "plant some seeds\n",
      "{'action_sequence': [{'action_type': 'BUILD',\n",
      "                      'repeat': {'repeat_count': [0, [1, 1]],\n",
      "                                 'repeat_key': 'FOR'},\n",
      "                      'schematic': {'has_name': [0, [2, 2]]}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'build', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'schematic': [[4, 4], [5, 5], [6, 6], [8, 8], [9, 9], [10, 10], [11, 11], [12, 12]]}\n",
      "please make me a poach egg with a toast with avocado on top\n",
      "{'action_sequence': [{'action_type': 'BUILD',\n",
      "                      'schematic': {'has_name': [0, [4, 5]],\n",
      "                                    'has_tag': [0, [8, 12]]}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'otheraction', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "push\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'OTHERACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[1, 1]]}\n",
      "show fire\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [1, 1]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'move', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'location': [[1, 1]]}\n",
      "stay here\n",
      "{'action_sequence': [{'action_type': 'MOVE',\n",
      "                      'location': {'contains_coreference': 'yes'}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'stop', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "stop in front of it\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'STOP'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'get', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'reference_object': [[2, 2]], 'source_location': [[5, 5]]}\n",
      "take some dirt from the pile\n",
      "{'action_sequence': [{'action_type': 'GET',\n",
      "                      'reference_object': {'filters': {'has_name': [0,\n",
      "                                                                    [2, 2]]}},\n",
      "                      'source_location': {}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "****************************************\n",
      "{'action_type': 'look', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "turn\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'LOOK'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "undo this wall i built and give me the resources\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n",
      "{'action_type': 'composite_action', 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "walk over to the brown boulder and pick it up\n",
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'COMPOSITE_ACTION'}]}\n",
      "All yes\n",
      "********************\n"
     ]
    }
   ],
   "source": [
    "# combine and write output to a file\n",
    "i  =0\n",
    "# what these action will look like in the map\n",
    "import json\n",
    "import copy\n",
    "dance_type_map = {\n",
    "    'point': 'point',\n",
    "    'look': 'look_turn',\n",
    "    'turn' : 'body_turn'\n",
    "}\n",
    "\n",
    "from pprint import pprint\n",
    "# update dict of tool1 with tool 2\n",
    "folder_name_combined = '/Users/kavyasrinet/Downloads/combined_tools'\n",
    "#folder_name_combined = '/Users/kavyasrinet/Downloads/'\n",
    "# with open(folder_name_combined + 'all_combined.txt', 'w') as f:\n",
    "with open(parent_folder + '/all_combined.txt', 'w') as f:\n",
    "    for cmd, a_dict in toolA_map.items():\n",
    "        # remove the ['yes', val] etc\n",
    "        clean_dict = clean_dict_1(a_dict)\n",
    "        print(clean_dict)\n",
    "        if all_yes(a_dict):\n",
    "            action_type = clean_dict['action_type']\n",
    "\n",
    "            valid_dict = {}\n",
    "            valid_dict['dialogue_type'] = clean_dict['dialogue_type']\n",
    "            del clean_dict['dialogue_type']\n",
    "            clean_dict['action_type'] = clean_dict['action_type'].upper()\n",
    "            act_dict = fix_spans(clean_dict)\n",
    "            valid_dict['action_sequence'] = [act_dict]\n",
    "        \n",
    "            f.write(cmd + \"\\t\" + json.dumps(valid_dict) + \"\\n\")\n",
    "            print(cmd)\n",
    "            print(valid_dict)\n",
    "            print(\"All yes\")\n",
    "            print(\"*\"*20)\n",
    "            continue\n",
    "        if clean_dict['action_type'] == 'noop':\n",
    "            f.write(cmd + \"\\t\" + json.dumps(clean_dict) + \"\\n\")\n",
    "            print(clean_dict)\n",
    "            print(\"NOOP\")\n",
    "            print(\"*\"*20)\n",
    "            continue\n",
    "        if clean_dict['action_type'] == 'otheraction':\n",
    "            f.write(cmd + \"\\t\" + str(a_dict) + \"\\n\")\n",
    "            continue\n",
    "\n",
    "        \n",
    "\n",
    "        if toolB_map and cmd in toolB_map:\n",
    "            #print(cmd)\n",
    "            child_dict_all = toolB_map[cmd]\n",
    "            # update action dict with all children except for reference object\n",
    "            for k, v in child_dict_all.items():\n",
    "                if k not in clean_dict:\n",
    "                    print(\"BUGGGG\")\n",
    "                if type(v) == str:\n",
    "                    v = ast.literal_eval(v)\n",
    "                #print(k, v)\n",
    "                if not v:\n",
    "                    continue \n",
    "\n",
    "                if 'reference_object' in v[k]:\n",
    "                    #print(\"HHHH\")\n",
    "                    value = v[k]['reference_object']\n",
    "                    v[k]['reference_object'] =  fix_ref_obj(value)\n",
    "    #                 new_clean_dict = {}\n",
    "    #                 up_dict = {}\n",
    "    #                 if 'special_reference' in val:\n",
    "    #                     new_clean_dict['special_reference'] = val['special_reference']\n",
    "    #                     val.pop('special_reference')\n",
    "    #                 if 'repeat' in val:\n",
    "    #                     new_clean_dict['repeat'] = val['repeat']\n",
    "    #                     val.pop('repeat')\n",
    "    #                 if val:\n",
    "    #                     new_clean_dict['filters'] = val\n",
    "    #                 up_dict['reference_object'] = new_clean_dict\n",
    "    #                 v = {k: up_dict}\n",
    "                #print(cmd, a_dict, child_dict)\n",
    "                if k == \"tag_val\":\n",
    "                    clean_dict.update(v)\n",
    "                elif k == \"facing\":\n",
    "                    action_type = clean_dict['action_type']\n",
    "                    # set to dance\n",
    "                    clean_dict['action_type'] = 'DANCE'\n",
    "                    clean_dict['dance_type'] = {dance_type_map[action_type]: v['facing']}\n",
    "                    clean_dict.pop('facing')\n",
    "                else:\n",
    "                    clean_dict[k] = v[k]\n",
    "    #     print(\"after tool B\")\n",
    "    #     pprint(clean_dict)\n",
    "    #     print(\"after tool C\")\n",
    "    #     # now add reference object dict\n",
    "    #     pprint(clean_dict)\n",
    "        ref_obj_dict = {}\n",
    "        if toolC_updated_map and cmd in toolC_updated_map:\n",
    "            ref_obj_dict = toolC_updated_map[cmd]\n",
    "        clean_dict.update(ref_obj_dict)\n",
    "        if 'receiver_reference_object' in clean_dict:\n",
    "            clean_dict['receiver'] = {'reference_object': clean_dict['receiver_reference_object']}\n",
    "            clean_dict.pop('receiver_reference_object')\n",
    "        if 'receiver_location' in clean_dict:\n",
    "            clean_dict['receiver'] = {'location': clean_dict['receiver_location']}\n",
    "            clean_dict.pop('receiver_location')\n",
    "\n",
    "        actual_dict = copy.deepcopy((clean_dict))\n",
    "\n",
    "        action_type = actual_dict['action_type']\n",
    "\n",
    "        valid_dict = {}\n",
    "        valid_dict['dialogue_type'] = actual_dict['dialogue_type']\n",
    "        del actual_dict['dialogue_type']\n",
    "        actual_dict['action_type'] = actual_dict['action_type'].upper()\n",
    "        act_dict = fix_spans(actual_dict)\n",
    "        valid_dict['action_sequence'] = [act_dict]\n",
    "        print(cmd)\n",
    "        pprint(valid_dict)\n",
    "        print(\"*\"*40)\n",
    "        f.write(cmd + \"\\t\" + json.dumps(valid_dict) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "43\n"
     ]
    }
   ],
   "source": [
    "with open('/Users/kavyasrinet/Github/annotated_data/with_get_give_bring/annotated_data_combined.txt') as f:\n",
    "    print(len(f.readlines()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "0\n",
      "0\n",
      "5\n"
     ]
    }
   ],
   "source": [
    "# for composites\n",
    "# now skip composite_action and separate otheraction from combined dicts\n",
    "mypath = '../../minecraft/python/craftassist/text_to_tree_tool/turk_data/composites/'\n",
    "mypath = '/Users/kavyasrinet/Downloads/'\n",
    "import ast\n",
    "import json\n",
    "\n",
    "f = []\n",
    "all_cnt  = 0\n",
    "cmp  = 0\n",
    "other = 0\n",
    "valid = 0\n",
    "all_comp = set()\n",
    "with open(mypath + \"all_combined.txt\") as f_read, open(mypath + 'all_combined_final.txt', 'w') as f:\n",
    "    for line in f_read.readlines():\n",
    "        line = line.strip()\n",
    "\n",
    "        text, d = line.split(\"\\t\")\n",
    "        actual_dict = ast.literal_eval(d.strip())\n",
    "        action_type = actual_dict['action_type']\n",
    "        if action_type == 'composite_action':\n",
    "            print(line)\n",
    "            cmp += 1\n",
    "            all_comp.add(text.strip())\n",
    "            continue\n",
    "        else:\n",
    "            valid += 1\n",
    "            valid_dict = {}\n",
    "            valid_dict['dialogue_type'] = actual_dict['dialogue_type']\n",
    "            del actual_dict['dialogue_type']\n",
    "            actual_dict['action_type'] = actual_dict['action_type'].upper()\n",
    "            valid_dict['action_sequence'] = [actual_dict]\n",
    "            f.write(text.strip() + \"\\t\" + json.dumps(valid_dict) + \"\\n\")\n",
    "print(cmp)\n",
    "print(len(all_comp))\n",
    "print(other)\n",
    "print(valid)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 548,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9\n",
      "9\n",
      "259\n",
      "1893\n"
     ]
    }
   ],
   "source": [
    "# now skip composite_action and separate otheraction from combined dicts\n",
    "mypath = '../../minecraft/python/craftassist/text_to_tree_tool/turk_data/composites/'\n",
    "from os import walk\n",
    "import ast\n",
    "import json\n",
    "\n",
    "f = []\n",
    "all_cnt  = 0\n",
    "cmp  = 0\n",
    "other = 0\n",
    "valid = 0\n",
    "all_comp = set()\n",
    "with open(mypath + \"all_final_annotations.txt\", 'w') as f_final, open(mypath + \"all_other_actions.txt\", 'w') as f_other:\n",
    "    for (dirpath, dirnames, filenames) in walk(mypath):\n",
    "        if filenames:\n",
    "            for file_name in filenames:\n",
    "                if not (file_name.startswith('.') or file_name in ['all_final_annotations.txt', 'all_other_actions.txt']):\n",
    "                    fn  = dirpath + file_name\n",
    "                    with open(fn) as f:\n",
    "                        #print(fn, len(f.readlines()))\n",
    "                        #all_cnt += len(f.readlines())\n",
    "                        for line in f.readlines():\n",
    "                            #print(line)\n",
    "                            line = line.strip()\n",
    "\n",
    "                            text, d = line.split(\"\\t\")\n",
    "                            actual_dict = ast.literal_eval(d.strip())\n",
    "                            #print(f)\n",
    "                            action_type = actual_dict['action_type']\n",
    "                            #print(action_type)\n",
    "                            #print(action_type)\n",
    "                            if action_type == 'composite_action':\n",
    "                                cmp += 1\n",
    "                                all_comp.add(text.strip())\n",
    "                                continue\n",
    "                            elif action_type[1] == 'otheraction':\n",
    "                                other += 1\n",
    "                                f_other.write(line + \"\\n\")\n",
    "                            else:\n",
    "                                valid += 1\n",
    "                                valid_dict = {}\n",
    "                                valid_dict['dialogue_type'] = actual_dict['dialogue_type']\n",
    "                                del actual_dict['dialogue_type']\n",
    "                                #print(actual_dict['action_type'])\n",
    "                                actual_dict['action_type'] = actual_dict['action_type'].upper()\n",
    "                                valid_dict['action_sequence'] = [actual_dict]\n",
    "                                f_final.write(text.strip() + \"\\t\" + json.dumps(valid_dict) + \"\\n\")\n",
    "print(cmp)\n",
    "print(len(all_comp))\n",
    "print(other)\n",
    "print(valid)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 647,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "\n",
    "        \n",
    "i = 0\n",
    "input_file = '../../minecraft/python/craftassist/text_to_tree_tool/turk_data/composites/all_combined_final.txt'\n",
    "output_file = '../../minecraft/python/craftassist/text_to_tree_tool/turk_data/composites/all_combined_final_postprocessed.txt'\n",
    "with open(input_file) as f, open(output_file, 'w') as f_w:\n",
    "    for line in f.readlines():\n",
    "        i+= 1\n",
    "        line = line.strip()\n",
    "        text, d = line.split(\"\\t\")\n",
    "        \n",
    "        d = ast.literal_eval(d)\n",
    "#         if text.split()[0] in ['put', 'place', 'install']:\n",
    "#             print(text, d['action_sequence'][0])\n",
    "        action_dict = fix_spans(d['action_sequence'][0])\n",
    "        if action_dict['action_type'] == 'TAG':\n",
    "            updated_dict = fix_put_mem(action_dict)\n",
    "            new_d = {}\n",
    "            new_d['dialogue_type'] = d['dialogue_type']\n",
    "            new_d.update(updated_dict)\n",
    "        elif action_dict['action_type'] == 'ANSWER':\n",
    "            #print(d)\n",
    "            new_d = {}\n",
    "            new_d['dialogue_type'] = 'GET_MEMORY'\n",
    "        else:\n",
    "            if action_dict['action_type'] == 'COPY':\n",
    "                action_dict['action_type'] = 'BUILD'\n",
    "            d['action_sequence'] = [action_dict]\n",
    "            new_d = d\n",
    "        f_w.write(text+  \"\\t\" + json.dumps(new_d) + \"\\n\")\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [],
   "source": [
    "def RepresentsInt(s):\n",
    "    try: \n",
    "        int(s)\n",
    "        return True\n",
    "    except ValueError:\n",
    "        return False\n",
    "\n",
    "    \n",
    "def find_int(sentence):\n",
    "    words= sentence.split()\n",
    "    for word in words:\n",
    "        if RepresentsInt(word):\n",
    "            return True\n",
    "    return False\n",
    "    \n",
    "import random\n",
    "def fix_int(sentence):\n",
    "    random_degrees = ['-90', '-45', '45', '90', '135', '-135', '180', '-180', '360', '-360']\n",
    "    words = sentence.strip().split()\n",
    "    new_words= []\n",
    "    for word in words:\n",
    "        if RepresentsInt(word) :#and 'degrees' in words:\n",
    "            random_num = random.randrange(-360, 360)\n",
    "            new_words.append(str(random_num))\n",
    "        else:\n",
    "            new_words.append(word)\n",
    "    \n",
    "    return \" \".join(new_words).strip()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: '/Users/kavyasrinet/Github/minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/all_combined.txt'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-86ca83cb00f8>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0morig_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'/Users/kavyasrinet/Github/minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/all_combined.txt'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      5\u001b[0m     \u001b[0;32mfor\u001b[0m \u001b[0mline\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreadlines\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      6\u001b[0m         \u001b[0mline\u001b[0m  \u001b[0;34m=\u001b[0m \u001b[0mline\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstrip\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/Users/kavyasrinet/Github/minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/all_combined.txt'"
     ]
    }
   ],
   "source": [
    "import json\n",
    "\n",
    "orig_data = {}\n",
    "with open('/Users/kavyasrinet/Github/minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/all_combined.txt') as f:\n",
    "    for line in f.readlines():\n",
    "        line  = line.strip()\n",
    "        t, d  =line.split(\"\\t\")\n",
    "        d = json.loads(d)\n",
    "        orig_data[t] = d\n",
    "print(len(orig_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 318,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "532\n"
     ]
    }
   ],
   "source": [
    "more_num_data = {}\n",
    "for k, v in orig_data.items():\n",
    "    if find_int(k):\n",
    "        for i in range(50):\n",
    "            new_t = fix_int(k)\n",
    "            more_num_data[new_t] = v\n",
    "        \n",
    "print(len(more_num_data.keys()))     "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 363,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "17\n"
     ]
    }
   ],
   "source": [
    "dirs_map = {\n",
    "    \"left\": \"-90\",\n",
    "    \"west\": \"-90\",\n",
    "    \"right\": \"90\",\n",
    "    \"east\": \"90\",\n",
    "    \"front\" : \"0\",\n",
    "    \"north\": \"0\",\n",
    "    \"back\": \"180\",\n",
    "    \"south\": \"180\",\n",
    "    \"front left\": \"-45\",\n",
    "    \"northwest\": \"-45\",\n",
    "    \"northeast\": \"45\",\n",
    "    \"front right\": \"45\",\n",
    "    \"southwest\": \"-135\",\n",
    "    \"southeast\": \"135\",\n",
    "    \"all the way around clockwise\": \"360\",\n",
    "    \"all the way around anticlockwise\": \"-360\",\n",
    "    \"all the way around\": \"360\"\n",
    "}\n",
    "\n",
    "vertical_dirs_map = {\n",
    "    \"up\": \"90\",\n",
    "    \"down\": \"-90\"\n",
    "}\n",
    "\n",
    "import copy\n",
    "print(len(dirs_map.keys()))\n",
    "\n",
    "def substitute_dirs(k, v, key_name='relative_yaw', alternate=False):\n",
    "    words = k.split()\n",
    "    new_words = []\n",
    "    new_d = copy.deepcopy(v)\n",
    "#     print(k)\n",
    "#     print(v)\n",
    "#     return{}\n",
    "    \n",
    "    # find other keys that are not this direction key\n",
    "    other_keys = []\n",
    "    for x in words:\n",
    "        if (x in dirs_map) or (x in vertical_dirs_map):\n",
    "            if (key_name == 'relative_yaw' and alternate == False) or (key_name == 'relative_pitch' and alternate==True):\n",
    "                new_d = copy.deepcopy(v)\n",
    "                k2 = list(new_d['dance_type'].keys())[0]\n",
    "                if (key_name in new_d['dance_type'][k2]) and (not new_d['dance_type'][k2][key_name].get('angle', None)):\n",
    "                    return {k : v}\n",
    "                if key_name not in new_d['dance_type'][k2]:\n",
    "                    return {k : v}\n",
    "                this_dir = x\n",
    "                other_keys = list(dirs_map.keys())\n",
    "                if this_dir in other_keys:\n",
    "                    other_keys.remove(this_dir)\n",
    "            elif (key_name == 'relative_yaw' and alternate == True) or (key_name == 'relative_pitch' and alternate==False):\n",
    "        \n",
    "                new_d = copy.deepcopy(v)\n",
    "                k2 = list(new_d['dance_type'].keys())[0]\n",
    "                if (key_name in new_d['dance_type'][k2]) and (not new_d['dance_type'][k2][key_name].get('angle', None)):\n",
    "                    return {k : v}\n",
    "                if key_name not in new_d['dance_type'][k2]:\n",
    "                    return {k : v}\n",
    "                this_dir = x\n",
    "                other_keys = list(vertical_dirs_map.keys())\n",
    "                if this_dir in other_keys:\n",
    "                    other_keys.remove(this_dir)\n",
    "\n",
    "    new_dict = {}\n",
    "    for k in other_keys:\n",
    "        new_words = []\n",
    "        new_d = copy.deepcopy(v)\n",
    "        \n",
    "        for x in words:\n",
    "            # if direction word, pick new\n",
    "            if (x in dirs_map) or (x in vertical_dirs_map):\n",
    "                # it has just one key\n",
    "                k2 = list(new_d['dance_type'].keys())[0]\n",
    "                if (key_name in new_d['dance_type'][k2]) and (not new_d['dance_type'][k2][key_name].get('angle', None)):\n",
    "                    print(\"BUGGGGG\")\n",
    "                new_words.append(k)\n",
    "                if alternate == False:\n",
    "                    if key_name == 'relative_yaw':\n",
    "                        new_d['dance_type'][k2][key_name]['angle'] = dirs_map[k]\n",
    "                    else:\n",
    "                        new_d['dance_type'][k2][key_name]['angle'] = vertical_dirs_map[k]\n",
    "                elif alternate == True:\n",
    "                    if key_name == 'relative_yaw':\n",
    "                        new_d['dance_type'][k2]['relative_pitch'] = {}\n",
    "                        new_d['dance_type'][k2]['relative_pitch']['angle'] = vertical_dirs_map[k]\n",
    "                        new_d['dance_type'][k2].pop('relative_yaw')\n",
    "                    elif key_name == 'relative_pitch':\n",
    "                        new_d['dance_type'][k2]['relative_yaw'] = {}\n",
    "                        new_d['dance_type'][k2]['relative_yaw']['angle'] = dirs_map[k]\n",
    "                        new_d['dance_type'][k2].pop('relative_pitch')\n",
    "                        \n",
    "            else:\n",
    "                new_words.append(x)\n",
    "        new_dict[\" \".join(new_words)] = new_d\n",
    "    return new_dict\n",
    "                "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 364,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'front right', 'northeast', 'all the way around anticlockwise', 'up', 'front', 'left', 'front left', 'right', 'southwest', 'west', 'north', 'south', 'all the way around clockwise', 'northwest', 'back', 'southeast', 'all the way around', 'east', 'down'}\n",
      "********************\n",
      "aim your head 10 degrees up {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'pitch_span': [[3, 3], [4, 4], [5, 5]]}}}}\n",
      "{'aim your head 10 degrees up': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'pitch_span': [[3, 3], [4, 4], [5, 5]]}}}}}\n",
      "--------------------\n",
      "face left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}\n",
      "{'face left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "face west {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}\n",
      "{'face west': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "look up {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'angle': '90'}}}}\n",
      "{'look down': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "move your head up a little {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'angle': '90'}}}}\n",
      "{'move your head down a little': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_pitch': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "rotate right {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}\n",
      "{'rotate right': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}}\n",
      "--------------------\n",
      "see to your left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}\n",
      "{'see to your left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'look_turn': {'relative_yaw': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "turn 30 degrees left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3]]}}}}\n",
      "{'turn 30 degrees left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3]]}}}}}\n",
      "--------------------\n",
      "turn 30 degrees to your left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]}}}}\n",
      "{'turn 30 degrees to your left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]}}}}}\n",
      "--------------------\n",
      "turn left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}\n",
      "{'turn left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "turn left a little {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [3, 3]]}}}}\n",
      "{'turn left a little': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [3, 3]]}}}}}\n",
      "--------------------\n",
      "turn northwest {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}\n",
      "{'turn northwest': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}}\n",
      "--------------------\n",
      "turn to my right {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}\n",
      "{'turn to my right': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}}\n",
      "--------------------\n",
      "turn to your left {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}\n",
      "{'turn to your left': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}}\n",
      "--------------------\n",
      "turn your body a little to the right {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[4, 4], [5, 5], [7, 7]]}}}}\n",
      "{'turn your body a little to the right': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[4, 4], [5, 5], [7, 7]]}}}}}\n",
      "--------------------\n",
      "turn your body left 48 degrees {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'yaw': [[3, 3], [4, 4], [5, 5]]}}}\n",
      "{'turn your body left 48 degrees': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'yaw': [[3, 3], [4, 4], [5, 5]]}}}}\n",
      "--------------------\n",
      "turn 87 degrees to the right {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3], [5, 5]]}}}}\n",
      "{'turn 87 degrees to the right': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [[1, 1], [2, 2], [3, 3], [5, 5]]}}}}}\n",
      "--------------------\n",
      "turn right {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}\n",
      "{'turn right': {'action_type': 'DANCE', 'dialogue_type': 'HUMAN_GIVE_COMMAND', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}}\n",
      "--------------------\n"
     ]
    }
   ],
   "source": [
    "more_rel_dir_data = {}\n",
    "all_dir_keys = set(dirs_map.keys())\n",
    "all_dir_keys.update(set(vertical_dirs_map.keys()))\n",
    "print(all_dir_keys)\n",
    "print(\"*\"*20)\n",
    "for k, v in orig_data.items():\n",
    "    words = k.split()\n",
    "    \n",
    "    if any(x in words for x in all_dir_keys):\n",
    "#         print(k, v)\n",
    "#         print(\"*\"*20)\n",
    "        \n",
    "        #this_dict = substitute_dirs(k, v, key_name='relative_yaw', alternate=False)\n",
    "        #this_dict = substitute_dirs(k, v, key_name='relative_yaw', alternate=True)\n",
    "        this_dict = substitute_dirs(k, v, key_name='relative_pitch', alternate=False)\n",
    "#         this_dict = substitute_dirs(k, v, key_name='relative_pitch', alternate=True)\n",
    "        more_rel_dir_data.update(this_dict)\n",
    "        print(k, v)\n",
    "        print(this_dict)\n",
    "        print(\"-\"*20)\n",
    "    \n",
    "#         print(len(more_rel_dir_data.keys()))\n",
    "#         print(more_rel_dir_data)\n",
    "#         print(k, v)\n",
    "#         break\n",
    "        #new_k, new_v = substitute_dirs(k, v)\n",
    "#print(len(more_rel_dir_data.keys()))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 275,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "599\n"
     ]
    }
   ],
   "source": [
    "orig_data.update(more_num_data)\n",
    "print(len(orig_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 276,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "691\n"
     ]
    }
   ],
   "source": [
    "orig_data.update(more_rel_dir_data)\n",
    "print(len(orig_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 277,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "691\n"
     ]
    }
   ],
   "source": [
    "new_postprocessed_data = {}\n",
    "for k, v in orig_data.items():\n",
    "    actual_dict = copy.deepcopy((v))\n",
    "    \n",
    "    action_type = actual_dict['action_type']\n",
    "\n",
    "    valid_dict = {}\n",
    "    valid_dict['dialogue_type'] = actual_dict['dialogue_type']\n",
    "    del actual_dict['dialogue_type']\n",
    "    actual_dict['action_type'] = actual_dict['action_type'].upper()\n",
    "    act_dict = fix_spans(actual_dict)\n",
    "    valid_dict['action_sequence'] = [act_dict]\n",
    "    \n",
    "    new_postprocessed_data[k] = valid_dict\n",
    "print(len(new_postprocessed_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 278,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('/Users/kavyasrinet/Github/minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/augmented_combined.json', 'w') as f:\n",
    "    json.dump(new_postprocessed_data, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 228,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('../../minecraft/python/craftassist/text_to_tree_tool/turk_data/new_dance_form_data/first_65/augmented_combined.json') as f:\n",
    "    data = json.load(f)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 279,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "500\n"
     ]
    }
   ],
   "source": [
    "gt_new = {}\n",
    "i = 0\n",
    "for k, v in new_postprocessed_data.items():\n",
    "    if i == 500:\n",
    "        break\n",
    "    else:\n",
    "        i += 1\n",
    "        gt_new[k] = v\n",
    "print(len(gt_new.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 315,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "turn -25 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 30 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 30 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn all the way around\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn around\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'location': {'location_type': 'AGENT_POS',\n",
      "                                                                'relative_direction': 'AROUND'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn away from me\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'location': {'location_type': 'SPEAKER_POS',\n",
      "                                                                'relative_direction': 'AWAY'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 90 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn left a little\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn like a top\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn northwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn towards the cow\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'location': {'location_type': 'REFERENCE_OBJECT',\n",
      "                                                                'reference_object': {'has_name': [0,\n",
      "                                                                                                  [3,\n",
      "                                                                                                   3]]},\n",
      "                                                                'relative_direction': 'FRONT'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn towards the monitor\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'location': {'location_type': 'REFERENCE_OBJECT',\n",
      "                                                                'reference_object': {'has_name': [0,\n",
      "                                                                                                  [3,\n",
      "                                                                                                   3]]},\n",
      "                                                                'relative_direction': 'AROUND'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn towards the sheep\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'location': {'location_type': 'REFERENCE_OBJECT',\n",
      "                                                                'reference_object': {'has_name': [0,\n",
      "                                                                                                  [3,\n",
      "                                                                                                   3]]}}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body a little to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [4,\n",
      "                                                                                  7]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 48 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your head towards the tree\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'look_turn': {'location': {'location_type': 'REFERENCE_OBJECT',\n",
      "                                                                'reference_object': {'has_name': [0,\n",
      "                                                                                                  [5,\n",
      "                                                                                                   5]]}}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 87 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 306 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -223 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -4 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 65 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -332 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -158 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 239 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 36 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -121 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -255 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 78 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 337 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 263 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 317 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 105 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -342 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -215 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -302 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 332 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -247 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 126 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -244 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -70 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -164 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 228 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -206 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -266 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -323 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 64 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 322 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -275 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -339 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -276 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 304 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -154 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -337 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 196 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -140 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -160 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -226 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 267 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 301 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 133 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 27 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -53 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -349 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  2]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 171 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -246 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 319 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 315 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -153 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -276 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -333 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 329 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -232 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 272 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -193 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -146 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 31 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 236 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -64 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -250 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 28 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -143 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 198 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 144 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 110 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 276 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 222 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -34 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -344 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 191 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 277 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -218 degrees left\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -156 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -183 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -320 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -122 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -136 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -281 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -80 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 134 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -85 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -152 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -5 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 210 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 105 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 51 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 68 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 184 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 89 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -159 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 239 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 41 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -228 degrees left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  3]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -92 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 332 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 269 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 219 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 151 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 271 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 136 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 225 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -24 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -39 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -292 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 259 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -106 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -140 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 359 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 145 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 358 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 154 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 207 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -212 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -281 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 94 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 101 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 155 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -303 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 289 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -73 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 306 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -3 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -46 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 128 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -313 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -223 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -4 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -227 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -23 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -294 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -139 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -72 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -134 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 298 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 342 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 313 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 282 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 188 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 346 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 4 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -111 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 212 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -174 degrees to your left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 172 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 5 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -198 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 34 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 26 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 281 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 167 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -234 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 139 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 321 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 32 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -74 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -217 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 198 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -312 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -15 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -49 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 249 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -42 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -337 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -124 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 314 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 292 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 56 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 354 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -228 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -151 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 353 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 72 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -285 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -189 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 165 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -215 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -205 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -170 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -158 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -24 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -179 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -214 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -153 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -40 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 348 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 100 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 74 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -118 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 95 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by 17 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn by -247 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [2, 3]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 304 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 75 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -13 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -37 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 23 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -196 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -80 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -336 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -94 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -35 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -169 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 97 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -269 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -51 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 52 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 63 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 321 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 117 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -285 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -59 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -132 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -21 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 190 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 202 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -223 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -33 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 54 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -53 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -185 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 199 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 82 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -227 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -286 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -117 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -31 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 263 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 276 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -52 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 278 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 114 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 99 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left 57 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -181 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -100 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -214 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -109 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn your body left -241 degrees\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'yaw': [0, [3, 5]]}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 115 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -209 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 39 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -96 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 168 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -40 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 285 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -212 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -249 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -350 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -170 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 250 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 91 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -217 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -296 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -157 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -216 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 182 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 25 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -61 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 112 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 237 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 162 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -42 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 303 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 41 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -97 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 79 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -281 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 36 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -272 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -144 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 257 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 254 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 338 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -192 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -164 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -260 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -55 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -302 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -259 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -291 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -23 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 304 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 125 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -275 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -35 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn 238 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn -263 degrees to the right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'yaw_span': [0,\n",
      "                                                                                 [1,\n",
      "                                                                                  5]]}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn west\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn east\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn front\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn north\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn back\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn south\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn front left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn northeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn front right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn southwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn southeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn all the way around clockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn all the way around antiuclockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my west\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my east\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my front\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my north\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my back\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my south\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my front left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my northwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my northeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my front right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my southwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my southeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my all the way around clockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my all the way around antiuclockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to my all the way around\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your west\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your east\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your front\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your north\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '0'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your back\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your south\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '180'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your front left\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your northwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your northeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your front right\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '45'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your southwest\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your southeast\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '135'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your all the way around clockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your all the way around antiuclockwise\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '-360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n",
      "turn to your all the way around\n",
      "{'action_sequence': [{'action_type': 'DANCE',\n",
      "                      'dance_type': {'body_turn': {'relative_yaw': {'angle': '360'}}}}],\n",
      " 'dialogue_type': 'HUMAN_GIVE_COMMAND'}\n",
      "********************\n"
     ]
    }
   ],
   "source": [
    "# look + up etc , + pitch \n",
    "# look right + yaw\n",
    "for k, v in new_postprocessed_data.items():\n",
    "    if 'turn' in k:\n",
    "        print(k)\n",
    "        pprint(v)\n",
    "        print(\"*\"*20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 282,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "431760\n"
     ]
    }
   ],
   "source": [
    "gt_data = {}\n",
    "with open('../../minecraft/python/craftassist/ground_truth_data.txt') as f:\n",
    "    for line in f.readlines():\n",
    "        text, ad = line.strip().split(\"\\t\")\n",
    "        ad_new = json.loads(ad)\n",
    "        if type(ad_new) == str:\n",
    "            ad_new = json.loads(ad_new)\n",
    "        gt_data[text] = ad_new\n",
    "print(len(gt_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 300,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'MOVE', 'RESUME', 'BUILD', 'STOP', 'SPAWN', 'DESTROY', 'FILL', 'UNDO', 'DANCE', 'FREEBUILD', 'DIG'}\n"
     ]
    }
   ],
   "source": [
    "all_actions = set()\n",
    "for k, v in gt_data.items():\n",
    "    if v['dialogue_type'] == 'HUMAN_GIVE_COMMAND' and 'action_sequence' in v and len(v['action_sequence']) == 1:\n",
    "        new_dict = copy.deepcopy(v)\n",
    "        act = new_dict['action_sequence'][0]\n",
    "        all_actions.add(act['action_type'])\n",
    "        \n",
    "#         if act['action_type'] == 'DANCE':\n",
    "#             if 'dance_type' in act and type(act['dance_type']) == dict:\n",
    "#                 key = list(act['dance_type'].keys())[0]\n",
    "#                 if 'relative_yaw' in act['dance_type'][key] and 'yaw' in act['dance_type'][key]:\n",
    "#                     act['dance_type'][key].pop('relative_yaw')\n",
    "#                     print(k,v )\n",
    "#                     print(k, act)\n",
    "#                     print(\"*\"*20)\n",
    "#                     #act['dance_type'][key].pop('relative_yaw')\n",
    "print(all_actions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 281,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "431760\n",
      "432171\n"
     ]
    }
   ],
   "source": [
    "print(len(gt_data.keys()))\n",
    "gt_data.update(gt_new)\n",
    "print(len(gt_data.keys()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 258,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('../../minecraft/python/craftassist/ground_truth_data.txt', 'w') as f:\n",
    "    for k, v in gt_data.items():\n",
    "        f.write(k + \"\\t\" + json.dumps(v)+ \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 263,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'dialogue_type': 'HUMAN_GIVE_COMMAND', 'action_sequence': [{'action_type': 'DANCE', 'dance_type': {'body_turn': {'relative_yaw': {'angle': '90'}, 'yaw': [0, [2, 3]]}}}]}\n"
     ]
    }
   ],
   "source": [
    "#print(gt_new)\n",
    "if 'turn by 14 degrees' in gt_new:\n",
    "    print(gt_new['turn by 14 degrees'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 260,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('../../minecraft/python/craftassist/ground_truth_data.txt') as f:\n",
    "    for line in f.readlines():\n",
    "        t , a = line.strip().split(\"\\t\")\n",
    "        a = json.loads(a)\n",
    "        if type(a) != dict:\n",
    "            print(\"nooooo\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
